﻿using DoNet.Common.Pages;
using DoNet.Core;
using DoNet.Core.Dtos;
using DoNet.System.Dtos;
using DoNet.System.Models;
using DoNet.ThirdParty.AutoMapper;
using SqlSugar;

namespace DoNet.System.IServices
{
    /// <summary>
    /// 
    /// </summary>
    public interface IAppService : IService<App, AppOutputDto>
    {
        #region 同步方法
        /// <summary>
        /// 同步获取app对象
        /// </summary>
        /// <param name="appid">应用ID</param>
        /// <returns></returns>
        App GetApp(string appid);
        /// <summary>
        /// 同步获取app对象
        /// </summary>
        /// <param name="appid">应用ID</param>
        /// <param name="secret">应用密钥AppSecret</param>
        /// <returns></returns>
        App GetApp(string appid, string secret);
        /// <summary>
        /// 同步根据条件查询数据库,并返回对象集合(用于分页数据显示)
        /// </summary>
        /// <param name="search">查询的条件</param>
        /// <returns>指定对象的集合</returns>
        PageResult<AppOutputDto> FindWithPagerSearch(SearchInputDto<App> search);
        #endregion 同步方法

        #region 异步方法
        /// <summary>
        /// 异步获取app对象
        /// </summary>
        /// <param name="appid">应用ID</param>
        /// <returns></returns>
        Task<App> GetAppAsync(string appid);
        /// <summary>
        /// 异步获取app对象
        /// </summary>
        /// <param name="appid">应用ID</param>
        /// <param name="secret">应用密钥AppSecret</param>
        /// <returns></returns>
        Task<App> GetAppAsync(string appid, string secret);
        /// <summary>
        /// 异步根据条件查询数据库,并返回对象集合(用于分页数据显示)
        /// </summary>
        /// <param name="search">查询的条件</param>
        /// <returns>指定对象的集合</returns>
        Task<PageResult<AppOutputDto>> FindWithPagerSearchAsync(SearchInputDto<App> search);
        #endregion 异步方法
    }
}
